package com.thyme.controller;

import com.thyme.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @author thyme
 * @ClassName TestController
 * @Description TODO
 * @Date 2020/5/4 16:36
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private RedisUtils redisUtils;


    @RequestMapping("/")
    public String index(@RequestParam("key") String key,@RequestParam("value") String value){
        redisUtils.set(key,value,200L, TimeUnit.SECONDS);
        return "OK";
    }

}
